clear;

load('datamarketG2')


dt=0.01;
T1=20;
t1=0:dt:T1;
nt1=length(t1);

nmk(1)=ss(1);


gnmk2=phiXmk2(1:flagstarmk2)-phiImk2(1:flagstarmk2);
for i=2:nt1
nmk(i)=nmk(i-1)+gnmk2(floor((nmk(i-1)-ss(1))/ds)+1)*dt;
end
for i=1:nt1
xmkt2(i)=xmk2(floor((nmk(i)-ss(1))/ds)+1);
ixmkt2(i)=ixmk2(floor((nmk(i)-ss(1))/ds)+1);
bsmkt2(i)=bsmk2(floor((nmk(i)-ss(1))/ds)+1);
end






subplot(2,2,1)


plot(t1,xmkt2,'LineWidth',1.5)
hold on;

xlabel('$t$','interpreter','latex','FontSize',12)
title('A. ${\bf x}_t$','interpreter','latex','FontSize',12)





subplot(2,2,2)

plot(t1,ixmkt2,'LineWidth',1.5)
hold on;

xlabel('$t$','interpreter','latex','FontSize',12)

title('B. ${\bf i}_t$','interpreter','latex','FontSize',12)




subplot(2,2,3)


plot(t1,A-xmkt2-ixmkt2,'LineWidth',1.5)
hold on;



xlabel('$t$','interpreter','latex','FontSize',12)
title('C. ${\bf c}_t$','interpreter','latex','FontSize',12)


subplot(2,2,4)

plot(t1,bsmkt2,'LineWidth',1.5)
hold on;



xlabel('$t$','interpreter','latex','FontSize',12)
title('D. $b_t$','interpreter','latex','FontSize',12)

print -depsc figure_base_xicb_stateGt5_new
